package com.palm.core.ui.tags;

import org.noear.solon.core.handle.Action;
import org.noear.solon.core.handle.Context;

public class TagInnerAction extends Action {
    public static final String backendFlag="__backend";
    public TagInnerAction(Action ac) {
        super(ac.bean(), ac.method().getMethod());
    }

    public Object invoke(Context c) {
        try {
            c.attrSet(backendFlag, true);
            return this.callDo(c, this.bean().raw(), this.method());
        } catch (Throwable e) {
            e.printStackTrace();
        } finally {
            c.attrSet(backendFlag, false);
        }
        return null;
    }
}
